<link rel="shortcut icon" href="favicon.ico">
<link href="__CSS__/bootstrap.min.css" rel="stylesheet">
<link href="__CSS__/font-awesome.min.css" rel="stylesheet">
<link href="__CSS__/animate.min.css" rel="stylesheet">
<link href="__CSS__/style.min.css" rel="stylesheet">
<link href="__CSS__/admin.css" rel="stylesheet">
<link href="__CSS__/cash.css" rel="stylesheet">	
	<div class="ibox-content">
	      <div class="" >
			<ul class="nav hs_nav pay_method" >
				 {foreach name="list" id="hou"}
				<li id="hou_li_{$hou.id}" data-parvalue="{$hou.parvalue}" data-discount="{$hou.discount}" data-type="{$hou.typeid}" data-name="{$hou.name}" data-id="{$hou.id}" >
					<p style="padding-top:10px;font-size: 16px;color: #2B303A;font-weight: 600;"><span >{$hou.name}</span></p>
					<p style="padding-top:10px;font-size: 14px;"><span >有效期至{$hou.overdue_time}</span></p>
				</li>
				{/foreach}
				{if condition="$list == null"} 
					<p><span class="rs_pan">没有优惠券</span></p>
				{/if}
			</ul>
  		</div>	
	</div>
	<div class="row" style="position: absolute;bottom:25px;right:50px;"><button class="btn btn-info">确定</button><button class="btn btn-default">取消</button></div>
<script src="__JS__/jquery.min.js"></script>
<script src="__JS__/bootstrap.min.js"></script>
<script src="__JS__/jquery.metisMenu.js"></script>
<script src="__LIB__/layer/layer.js"></script>
<script>
	$(".btn-info").click(function(){
		    var room=$(".room-selected");
	    	if(room==undefined){
	    		layer.msg("未选择优惠券");
	    		return false;
	    	}
	    	var name=room.attr("data-name");
	    	var id=room.attr("data-id");
	    	var parvalue=room.attr("data-parvalue");
	    	var discount=room.attr("data-discount");
	    	var typeid=room.attr("data-type");
	    	var html='<span id="counpon_span" style="color:red;" data-parvalue='+parvalue+' data-discount='+discount+' data-type='+typeid+'  data-id='+id+'>'+name+'</span>';
	    	$("#coupon_juan",parent.document).html(html);
	    	//代币券
	    	var price=$("#price",parent.document).val();
	    	if(typeid==1){
	    		var ys_money=parseFloat(price)-parseFloat(parvalue);
	    		$("#ys_money",parent.document).val(ys_money);
	    	}else{
	    		$("#ys_money",parent.document).val(price*parseFloat(discount)/100);
	    	}
	    	var index = parent.layer.getFrameIndex(window.name); //获取窗口索引  
        	parent.layer.close(index);  
 	})
 	$(".btn-default").click(function(){
	    var index = parent.layer.getFrameIndex(window.name); //获取窗口索引  
        parent.layer.close(index);  
 	})
 	$(".hs_nav li").click(function(){
	    	$(".room-selected").removeClass("room-selected");
	    	var id=$(this).attr("data-id");
	    	$(this).addClass("room-selected");
 	})
</script>
